package org.googlecode.viewt.core.tools.dao;

import org.googlecode.viewt.core.tools.po.BasePOGenerator;
import org.googlecode.viewt.core.tools.po.POConfigUtil;

public class ImpGenerator extends BasePOGenerator {
	public static final String CONTEXT_PROP_DAOUTIL = "DAOUTILITY";

	public String getLoggerCategory() {
		return "DAOImpGenerator";
	}

	public String getPackageTemplatePath() {
		return "resource/template/dao";
	}

	public String getTemplate(String className) throws Exception {
		return "java_IMP.vm";
	}

	public String getOutputFile(String className) throws Exception {
		return POConfigUtil.fullJavaFileName(getDestPath(), DAOUtils
				.daoImpClassName(className));
	}

	public boolean needGenerate(String className) throws Exception {
		return true;
	}

	public void setupContext() throws Exception {
		getContext().put("DAOUTILITY", new DAOUtils());
	}

	public void setupContext(String className) throws Exception {
	}

	public void cleanContext(String className) throws Exception {
	}

	public void cleanContext() throws Exception {
		getContext().remove("DAOUTILITY");
	}
}